/*
 * bsp_register_map.h
 *
 *  Created on: 2025骞�4鏈�9鏃�
 *      Author: 22332
 */

#ifndef BSP_REGISTER_MAP_H_
#define BSP_REGISTER_MAP_H_
#include "sdk_project_config.h"

#define PMIC_Slave_Address          (uint16_t)0x6B;

#define PAVDD                       0x00U
#define NAVDD                       0x01U
#define VGH                         0x02U
#define VGL                         0x03U
#define VCOM_C                      0x04U
#define VGH_LOW_TEMP                0x05U
#define SW_FREQ                     0x06U
#define PAVDD_ON_DELAY              0x07U
#define PAVDD_SOFT_START            0x08U
#define VGL_ON_DELAY                0x09U
#define VGL_SOFT_START              0x0AU
#define VGH_ON_DELAY                0x0BU
#define VGH_SOFT_START              0x0CU
#define NAVDD_ON_DELAY              0x0DU
#define NAVDD_SOFT_START            0x0EU
#define VCOM_ON_DELAY               0x0FU
#define RESET_ON_DELAY              0x10U
#define POWER_OFF_DELAY             0x11U
#define OPTION1                     0x12U
#define OPTION2                     0x13U
#define OPTION3                     0x14U
#define CHANNEL_ON_OFF_OPTION       0x16U
#define AUTO_REFRESH_OPTION         0x17U
#define PAVDD_OFF_DELAY             0x18U
#define NAVDD_OFF_DELAY             0x19U
#define VGH_OFF_DELAY               0x1AU
#define VGL_OFF_DELAY               0x1BU
#define FAULT_VCOM                  0x1CU
#define FAULT_ANALYSIS              0x1DU


#define MAX25512_Slave_Address      0x22U


#define DEV_ID_REG                   0x00U
#define REV_ID_REG                   0x01U
#define ISET_REG                     0x02U
#define IMOD_REG                     0x03U
#define ADIM_REG                     0x04U
#define TON1H_REG                    0x05U
#define TON1L_REG                    0x06U
#define TON2H_REG                    0x07U
#define TON2L_REG                    0x08U
#define TON3H_REG                    0x09U
#define TON3L_REG                    0x0AU
#define TON4H_REG                    0x0BU
#define TON4L_REG                    0x0CU
#define TON1_4LSB_REG                0x0DU
#define SETTING_REG                  0x0EU
#define DISABLE_REG                  0x0FU
#define FADING_REG                   0x10U
#define OPEN_REG                     0x11U
#define SHORTGND_REG                 0x12U
#define SHORT_LED_REG                0x13U
#define MASK_REG                     0x14U
#define DIAG_REG                     0x15U
typedef enum{

LCD_BACKLIGHT_PWM                        = 0x03U,
LCD_BACKLIGHT_SWITCH                 = 0x04U,
DAY_NIGHT_MODE                       = 0x07U,
TOUCH_RESET                          = 0x11U,
UPDATE_WRITE                         = 0x23U,
TIME_STAMP                           = 0x24U,

} master_write;

typedef enum{
LCD_BACKLIGHT_FB                     = 0x02U,
DIAGNOSTIC_STATUS1                   = 0x0AU,
DIAGNOSTIC_STATUS2                   = 0x0BU,
LCD_BACKLIGHT_SWITCH_STATE           = 0x05U,
LCD_TEMPURATURE                      = 0x0FU,
UPDATE_READ                          = 0x22U,
LCD_BACKLIGHT_AMBIENT_LIGHT_SENSOR   = 0x31U,
I2C_CLASSIFY_VERSION0_READ           = 0x40U,
I2C_CLASSIFY_VERSION1_READ           = 0x41U,
I2C_CLASSIFY_VERSION2_READ           = 0x42U,
I2C_CLASSIFY_VERSION3_READ           = 0x43U,
I2C_CLASSIFY_FBL_VERSION0_READ       = 0x44U,
I2C_CLASSIFY_FBL_VERSION1_READ       = 0x45U,
I2C_CLASSIFY_FBL_VERSION2_READ       = 0x46U,
LCD_TYPE                             = 0x50U,
TP_type                              = 0x51U,
PN_VERSION0                          = 0x60U,
PN_VERSION1                          = 0x61U,
PN_VERSION2                          = 0x62U,
PN_VERSION3                          = 0x63U,
PN_VERSION4                          = 0x64U,
PN_VERSION5                          = 0x65U,
HARDWARE_VERSION0                    = 0x70U,
HARDWARE_VERSION1                    = 0x71U,
HARDWARE_VERSION2                    = 0x72U,
HARDWARE_VERSION3                    = 0x73U,
HARDWARE_VERSION4                    = 0x74U,
HARDWARE_VERSION5                    = 0x75U,
SOFTWARE_VERSION0                    = 0x80U,
SOFTWARE_VERSION1                    = 0x81U,
SOFTWARE_VERSION2                    = 0x82U,
SOFTWARE_VERSION3                    = 0x83U,
SOFTWARE_VERSION4                    = 0x84U,
SOFTWARE_VERSION5                    = 0x85U,
BOOTLOADER_VERSION                   = 0x86U,
I2C_CLASSIFY_FLASH_VERSION_READ      = 0x95U,
DISPLAY_SELF_CHECK_INFO              = 0xB0U,
} master_read;

typedef enum
{
    EOL_CUSTOMER_SW_VERSION = 0x01,
    EOL_PN_VERSION = 0x02,
    EOL_CUSTOMER_HW_VERSION = 0x03,
    EOL_PANNL_HARDWARE = 0x04,
    EOL_PANNL_SOFTWAER = 0x05,
    EOL_BLACKLIGHT_EN = 0x06,
    EOL_BLACKLIGHT_DUTY = 0x07,
    EOL_DIAGNOSTIC_1 = 0x08,
    EOL_DIAGNOSTIC_2 = 0x09,
    EOL_TEMP_AD_VALUE = 0x0A,
    EOL_TFT_COLOR_SET = 0x30,
    EOL_DH_SW_VERSION = 0x50,
    EOL_DH_HW_VERSION = 0x51,
}EOL_TEST;


#define RM5T500A_Slave_Address       0x60U


typedef enum{
    EVENT_TP = 0x00,
    EVENT_DCLK,
    EVENT_HS,
    EVENT_LOCK,
    EVENT_SD,
    EVENT_POWER,
    EVENT_VDPA,
} register_event;
typedef enum{
    TP_WDT_ERROR                        = 0,
    TP_Configuration_CRC_Error          = 2,
    TP_Sensor_open_short_test           = 4,
    TP_Flash_load_CRC_Error             = 6,
    TP_Flash_data_load_CRC_Error        = 15,
}   err_50000060;

typedef enum{
    DCLK_Detection_Port1                = 20,
    DCLK_Detection_Port2                = 21,
    DE_Detection                        = 17,
    Float_Detection_in_LVDS             = 16,
    SDNOFB_Feedback_STH_Detection       = 19,
    GDNOFB_Feedback_STV_Detection       = 18,
}   err_50002188;
typedef enum{
    HS_Detection                        = 0,
    VS_Stop_Detection                   = 1,
    Data_CRC                            = 2,

}   err_5000218C;
typedef enum{
    LOCK_Detection_in_LVDS              = 29,
    OEV_Stop_Detection                  = 30,
    POL_Stop_Detection                  = 31,
    GOA_ASIL_GOA_Detection_Feedback     = 0,

}   err_5000225C;
typedef enum{
    EDT_PA_OVP_FLAG                     = 25,
    EDT_PA_UVP_FLAG                     = 26,
    EDT_NA_OVP_FLAG                     = 27,
    EDT_NA_UVP_FLAG                     = 28,
    EDT_VGH_OVP_FLAG                    = 29,
    EDT_VGH_UVP_FLAG                    = 30,
    EDT_VGL_OVP_FLAG                    = 31,
    EDT_VGL_UVP_FLAG                    = 0,
    EDT_VCOM_OVP_FLAG                   = 1,
    EDT_VCOM_UVP_FLAG                   = 2,

}   err_50002264;
typedef enum{
    STV_Detection                       = 4,
    CKV_Detection                       = 3,

}   err_50002268;
typedef enum{
    VDPA_VDNA_Fail_Ext                   = 13,
    VDPA_VDNA_Fail_Int                   = 12,
    EDT_VDNA_OCP_FLAG                    = 11,
    EDT_VDPA_OCP_FLAG                    = 10,
    Flash_Checksum_Detection             = 24,
    Register_Checksum_Detection          = 20,
    Thermal_Ultra_High_Detection         = 16,
    XON_Detection                        = 8,
}   err_50002258;

typedef enum{
	PTGN_RED                   = 0,
	PTGN_WHITE,
	PTGN_BLACK,
	PTGN_CBAR_A,
	PTGN_BLUE,
	PTGN_GREEN,
	PTGN_FLICKER,
	PTGN_CROSS_B,
	PTGN_CROSS_A,
	PTGN_CHESS_B,
	PTGN_CHESS_A,
	PTGN_H_GRAY_B,
	PTGN_H_GRAY_A,
	PTGN_CBAR_B,
	PTGN_SPONOFF,
	PTGN_PONOFF,
	PTGN_WFRAME_B,
	PTGN_WFRAME_A,
	PTGN_GLEVEL,
	PTGN_RGBW,
	PTGN_V_GRAY_B,
	PTGN_V_GRAY_A,
	PTGN_H_BW_B,
	PTGN_H_BW_A,
}color_pattern;

#pragma pack(1)
typedef struct DIAGNOSE1_DATA
{
    uint8_t LOW_VOL_FAIL:1;
    uint8_t HIGH_VOL_FAIL:1;
    uint8_t LCD_FAIL:1;
    uint8_t BACKLIGHT_FAIL:1;
    uint8_t LCD_TEMPERATURE_HIGH:1;
    uint8_t LCD_NTC_FAIL:1;
    uint8_t RESERVER6:1;
    uint8_t RESERVER7:1;
}ST_DIAGNOSE1_DATA;

typedef struct DIAGNOSE2_DATA
{
	uint8_t ENABLE_SIGNAL_FAIL:1;
    uint8_t MASTER_IIC_FAIL:1;
    uint8_t LOCK_FAIL:1;
    uint8_t TOUCH_IIC_FAIL:1;
    uint8_t WATCH_DOG_FAIL:1;

    uint8_t PMIC_FAIL:1;//RTQ6749
    uint8_t LDO_1V2_FAIL:1;
    uint8_t SW_3V3_FAIL:1;
}ST_DIAGNOSE2_DATA;
#pragma pack()

typedef struct
{
	void *rxbuf;
	int rxlength;
	void *txbuf;
	int txlength;
	void *fun;
} ST_SLAVE_I2C_DATA;

#endif /* BSP_REGISTER_MAP_H_ */
